/*
 * Report.java
 *
 * Created on April 10, 2012, 8:38 PM
 */

package BillManage;
import Check.Check;
import Check.DateChooser;
import java.awt.Frame;

import java.sql.SQLException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Vector;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFormattedTextField;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import javax.swing.text.MaskFormatter;

/**
 *
 * @author  manh
 */
public final class Report extends javax.swing.JPanel {
     Check c = new Check();
    private DefaultTableModel ModelTableBillWaitting = new DefaultTableModel();
    Vector vloadWaitting = new Vector();
    
     private DefaultTableModel ModelTableBillOverdue = new DefaultTableModel();
    Vector vloadOverdue = new Vector();
    
     private DefaultTableModel ModelTableBillComplete = new DefaultTableModel();
    Vector vloadComplete = new Vector();
    private DefaultComboBoxModel cbmdType = new DefaultComboBoxModel();
   
    /** Creates new form Report */
    public Report() {
        initComponents();
        try {
            vloadWaitting = Bills.getBillsWaittingForReport();
            this.loadBillWaitting("vBillWaitting",vloadWaitting);
            
            vloadOverdue = Bills.getBillsOverdueForReport();
            this.loadBillOverdue("vBillOverdue",vloadOverdue);
            
             vloadComplete = Bills.getBillsCompleteForReport();
            this.loadBillComplete("vBillComplete",vloadComplete);
              cbmdType.removeAllElements();
            cbmdType.addElement("--- All Type---");
            cbmdType.addElement("Purchase");
            cbmdType.addElement("Sale");
          
            txtType.setModel(cbmdType);
            txtType2.setModel(cbmdType);
            txtType3.setModel(cbmdType);


        } catch (SQLException ex) {
        }
    }
    /////////////////////////////////////////
    public boolean check(){
         Check c = new Check();
        if((txfDateStart.getText().trim()).compareTo((txfExpiredTime.getText().trim())) >0)
        {
            JOptionPane.showMessageDialog(this," Date start cannot more than Expired !","Create new order",JOptionPane.ERROR_MESSAGE);
            txfDateStart.setText("");
            txfDateStart.requestFocus();
            return false;
        }
             else if(!c.checkDateIn(txfExpiredTime.getText())){
            JOptionPane.showMessageDialog(this,"Expired invalid !","Create new order",JOptionPane.ERROR_MESSAGE);
            txfExpiredTime.setText("");
            txfExpiredTime.requestFocus();
            return false;
        }
           else if(!c.checkDateIn(txfDateStart.getText())){
            JOptionPane.showMessageDialog(this,"Date start invalid !","Create new order",JOptionPane.ERROR_MESSAGE);
            txfDateStart.setText("");
            txfDateStart.requestFocus();
            return false;
        }
  
        return true;
        /////////////////////////////////////////

    }
     public boolean check1(){
         Check c = new Check();
        if((txtDateStart.getText().trim()).compareTo((txtExpiredDay.getText().trim())) >0)
        {
            JOptionPane.showMessageDialog(this," Date start cannot more than Expired !","Create new order",JOptionPane.ERROR_MESSAGE);
          //  txtDateStart.setText("");
            txtDateStart.requestFocus();
            return false;
        }
             else if(!c.checkDateIn(txtExpiredDay.getText())){
            JOptionPane.showMessageDialog(this,"Expired invalid !","Create new order",JOptionPane.ERROR_MESSAGE);
            //txtExpiredDay.setText("");
            txtExpiredDay.requestFocus();
            return false;
        }
           else if(!c.checkDateIn(txtDateStart.getText())){
            JOptionPane.showMessageDialog(this,"Date start invalid !","Create new order",JOptionPane.ERROR_MESSAGE);
           // txtDateStart.setText("");
            txtDateStart.requestFocus();
            return false;
        }

        return true;
    }
     ///////////////////////////////////////
   
     public void loadBillWaitting(String namTable,Vector vload){
        ModelTableBillWaitting.setNumRows(0);
        Vector columnBillWaitting = new Vector();
        columnBillWaitting.addElement("BillTYpe");
        columnBillWaitting.addElement("customerName");
        columnBillWaitting.addElement("Relationship");
         columnBillWaitting.addElement("DateStart");
        columnBillWaitting.addElement("Price");
        columnBillWaitting.addElement("status");
        columnBillWaitting.addElement("Creater");
       // columnBillWaitting.addElement("DateStart");
        ModelTableBillWaitting.setColumnIdentifiers(columnBillWaitting);
        Bills objBills = new Bills();
        for(int i = 0; i<vload.size();i++){
            objBills = (Bills) vload.get(i);
            Vector rowBillWaitting = new Vector();
            rowBillWaitting.addElement(objBills.getbillType());
            rowBillWaitting.addElement(objBills.getcustomerName());
            rowBillWaitting.addElement(objBills.getrelationship());
             rowBillWaitting.addElement(objBills.getdateStart());//      rowBillWaitting.addElement(objBills.getexpiredTime());
            rowBillWaitting.addElement(objBills.getprice());
            rowBillWaitting.addElement(objBills.getstatus());
            rowBillWaitting.addElement(objBills.getuserName());
        //     rowBillWaitting.addElement(objBills.getdateStart());
            ModelTableBillWaitting.addRow(rowBillWaitting);
        }
        tableBillsWaitting.setModel(ModelTableBillWaitting);
    }
    
    //load billoverdue
     public void loadBillOverdue(String namTable,Vector vload){
        ModelTableBillOverdue.setNumRows(0);
        Vector columnBillOverdue = new Vector();
        columnBillOverdue.addElement("BillTYpe");
        columnBillOverdue.addElement("customerName");
        columnBillOverdue.addElement("Relationship");
        columnBillOverdue.addElement("ExpiredDate");
        columnBillOverdue.addElement("Price");
        columnBillOverdue.addElement("status");
        columnBillOverdue.addElement("Creater");
        ModelTableBillOverdue.setColumnIdentifiers(columnBillOverdue);
        Bills objBills = new Bills();
        for(int i = 0; i<vload.size();i++){
            objBills = (Bills) vload.get(i);
            Vector rowBillOverdue = new Vector();
            rowBillOverdue.addElement(objBills.getbillType());
            rowBillOverdue.addElement(objBills.getcustomerName());
            rowBillOverdue.addElement(objBills.getrelationship());
            rowBillOverdue.addElement(objBills.getexpiredTime());
            rowBillOverdue.addElement(objBills.getprice());
            rowBillOverdue.addElement(objBills.getstatus());
            rowBillOverdue.addElement(objBills.getuserName());
            ModelTableBillOverdue.addRow(rowBillOverdue);
        }
        tableBillsOverDue.setModel(ModelTableBillOverdue);
    }
     
      public void loadBillComplete(String namTable,Vector vload){
        ModelTableBillComplete.setNumRows(0);
        Vector columnBillComplete = new Vector();
        columnBillComplete.addElement("BillCode");
        columnBillComplete.addElement("BillTYpe");
        columnBillComplete.addElement("customerName");
        columnBillComplete.addElement("Relationship");
        columnBillComplete.addElement("Price");
        columnBillComplete.addElement("status");
        columnBillComplete.addElement("Creater");
        ModelTableBillComplete.setColumnIdentifiers(columnBillComplete);
        Bills objBills = new Bills();
        for(int i = 0; i<vload.size();i++){
            objBills = (Bills) vload.get(i);
            Vector rowBillComplete = new Vector();
            rowBillComplete.addElement(objBills.getbillCode());
            rowBillComplete.addElement(objBills.getbillType());
            rowBillComplete.addElement(objBills.getcustomerName());
            rowBillComplete.addElement(objBills.getrelationship());
            rowBillComplete.addElement(objBills.getprice());
            rowBillComplete.addElement(objBills.getstatus());
            rowBillComplete.addElement(objBills.getuserName());
            ModelTableBillComplete.addRow(rowBillComplete);
        }
        tableBillsComplete.setModel(ModelTableBillComplete);
    }
   
    
      
     public void deleteBill(){
        Vector vLoadBill = new Vector();
        int show = JOptionPane.showConfirmDialog(this,"Are you sure delete Bill ?","Remove Bill",JOptionPane.YES_NO_OPTION);
        if(show == JOptionPane.YES_OPTION){
            int test = 0, count = 0;
            int [] rArr = tableBillsComplete.getSelectedRows();
            try{
                for(int i = 0; i < rArr.length; i++){
                    int billCode = Integer.parseInt(tableBillsComplete.getValueAt(rArr[i],0).toString());
                    test = Bills.deleteBill(billCode);
                    if(test == 1)
                        count++;
                }
                if(count >= 0){
                    JOptionPane.showMessageDialog(this,"Delete "+count+" Bill","Remove Bill",JOptionPane.INFORMATION_MESSAGE);
                    vLoadBill = Bills.getBillsCompleteForReport();
       //             vLoadBill=Bills.getAllBillsWaitting();
                    this.loadBillComplete("vBillNotDetails",vLoadBill);
                }
               
            }catch(SQLException ex){
                System.err.println(ex.getMessage());
            }
        }
    }
     ///////////////////////////////////
     public void SearchBillWaitting() throws SQLException
    { Vector vList = new Vector();
       if(!this.check()){
            return;
        }
      if(txfDateStart.getText()!="" && txfExpiredTime.getText()!="" && txtType.getSelectedIndex()==0 )
         {
         vList.addElement(txfDateStart.getText().trim());
         vList.addElement(txfExpiredTime.getText().trim());
             vloadWaitting=Bills.getSearchBillWaitting(vList);
             this.loadBillWaitting("Bills", vloadWaitting);
         }

 else if (txfDateStart.getText() != "" && txfExpiredTime.getText() != "" && txtType.getSelectedIndex() != 0)
         {
         vList.addElement(txtType.getSelectedItem().toString());
         vList.addElement(txfDateStart.getText().trim());
         vList.addElement(txfExpiredTime.getText().trim());
             vloadWaitting=Bills.getSearchBillWaittingTypeandTime(vList);
             this.loadBillWaitting("Bills", vloadWaitting);
         }
    
    }
  //////////////////////////
          public void SearchBillOverduce() throws SQLException
    { Vector vList = new Vector();
       if(!this.check1()){
            return;
        }
      if(txtDateStart.getText()!="" && txtExpiredDay.getText()!="" && txtType2.getSelectedIndex()==0 )
         {
         vList.addElement(txtDateStart.getText().trim());
         vList.addElement(txtExpiredDay.getText().trim());
             vloadOverdue=Bills.SearchBillsOverdueTime(vList);
             this.loadBillOverdue("Bills", vloadOverdue);
         }

 else if (txtDateStart.getText() != "" && txtExpiredDay.getText() != "" && txtType2.getSelectedIndex() != 0)
         {
         vList.addElement(txtType2.getSelectedItem().toString());
         vList.addElement(txtDateStart.getText().trim());
         vList.addElement(txtExpiredDay.getText().trim());
             vloadOverdue=Bills.SearchBillsOverdueTimeType(vList);
             this.loadBillOverdue("Bills", vloadOverdue);
         }

    }
          /////////////////////////////////////
            public void SearchBillComple() throws SQLException
    { Vector vList = new Vector();

      if( txtType3.getSelectedIndex()!=0 )
         {
       vList.addElement(txtType3.getSelectedItem().toString());
             vloadComplete=Bills.SearchBillsComplete(vList);
             this.loadBillComplete("Bills",vloadComplete);
         


    }
       if( txtType3.getSelectedIndex()==0 )
         {
       //vList.addElement(txtType3.getSelectedItem().toString());
             vloadComplete=Bills.getBillsCompleteForReport();
             this.loadBillComplete("Bills",vloadComplete);



    }
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        tableBillsWaitting = new javax.swing.JTable();
        jPanel7 = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        txfDateStart = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        txfExpiredTime = new javax.swing.JTextField();
        txtSearch = new javax.swing.JButton();
        jLabel8 = new javax.swing.JLabel();
        txtType = new javax.swing.JComboBox();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jToggleButton1 = new javax.swing.JToggleButton();
        jPanel2 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        tableBillsOverDue = new javax.swing.JTable();
        jPanel8 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        txtType2 = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        txtDateStart = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        txtExpiredDay = new javax.swing.JTextField();
        try {
            txtExpiredDay = new JFormattedTextField(new MaskFormatter("####-##-##"));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }
        txtOK = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jButton5 = new javax.swing.JButton();
        jPanel3 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        btnRemove = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tableBillsComplete = new javax.swing.JTable();
        jPanel9 = new javax.swing.JPanel();
        txtType3 = new javax.swing.JComboBox();
        txtSearch1 = new javax.swing.JButton();
        jLabel6 = new javax.swing.JLabel();
        jButton6 = new javax.swing.JButton();

        jTabbedPane1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        jPanel1.setForeground(new java.awt.Color(0, 102, 102));
        jPanel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        jLabel1.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel1.setForeground(new java.awt.Color(51, 51, 255));

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Billing information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(24, 105, 105))); // NOI18N

        tableBillsWaitting.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane1.setViewportView(tableBillsWaitting);

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 714, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 149, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(18, Short.MAX_VALUE))
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search by date", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 13), new java.awt.Color(16, 70, 70))); // NOI18N
        jPanel7.setForeground(new java.awt.Color(153, 153, 153));

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel4.setText("From");

        try {
            txfDateStart = new JFormattedTextField(new MaskFormatter("####-##-##"));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel5.setText("to");

        try {
            txfExpiredTime = new JFormattedTextField(new MaskFormatter("####-##-##"));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }

        txtSearch.setFont(new java.awt.Font("Tahoma", 1, 12));
        txtSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/search2.png"))); // NOI18N
        txtSearch.setText("Search");
        txtSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtSearchActionPerformed(evt);
            }
        });

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel8.setText("Bill Type");

        jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/calendar-date-16x16.png"))); // NOI18N
        jButton1.setText("Date");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jButton2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/calendar-date-16x16.png"))); // NOI18N
        jButton2.setText("Date");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        jToggleButton1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jToggleButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/reset.png"))); // NOI18N
        jToggleButton1.setText("Reset");
        jToggleButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jToggleButton1ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel8)
                        .addGap(18, 18, 18)
                        .addComponent(txtType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addComponent(jLabel4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txfDateStart, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 75, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(txfExpiredTime, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton2)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 29, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jToggleButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 99, Short.MAX_VALUE)
                    .addComponent(txtSearch, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(txtType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtSearch))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(txfDateStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1)
                    .addComponent(jLabel5)
                    .addComponent(txfExpiredTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton2)
                    .addComponent(jToggleButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(36, 36, 36)
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 352, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGap(87, 87, 87)
                        .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(44, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(80, 80, 80))
        );

        jTabbedPane1.addTab("Bill Waiting", new javax.swing.ImageIcon(getClass().getResource("/Icon/bill.png")), jPanel1); // NOI18N

        jPanel2.setForeground(new java.awt.Color(0, 102, 102));
        jPanel2.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        jLabel2.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel2.setForeground(new java.awt.Color(0, 51, 255));

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Billing information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(12, 71, 71))); // NOI18N

        tableBillsOverDue.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(tableBillsOverDue);

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 724, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(18, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 117, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(34, Short.MAX_VALUE))
        );

        jPanel8.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search by date", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 13), new java.awt.Color(24, 110, 110))); // NOI18N

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel9.setText("Bill Type");

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel10.setText("from");

        try {
            txtDateStart = new JFormattedTextField(new MaskFormatter("####-##-##"));
        } catch (ParseException ex) {
            ex.printStackTrace();
        }

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel11.setText("to");

        txtOK.setFont(new java.awt.Font("Tahoma", 1, 12));
        txtOK.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/search2.png"))); // NOI18N
        txtOK.setText("Search");
        txtOK.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtOKActionPerformed(evt);
            }
        });

        jButton3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/calendar-date-16x16.png"))); // NOI18N
        jButton3.setText("Date");
        jButton3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton3ActionPerformed(evt);
            }
        });

        jButton4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/calendar-date-16x16.png"))); // NOI18N
        jButton4.setText("Date");
        jButton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton4ActionPerformed(evt);
            }
        });

        jButton5.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/reset.png"))); // NOI18N
        jButton5.setText("Reset");
        jButton5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10))
                .addGap(18, 18, 18)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtType2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(txtDateStart, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton3)
                        .addGap(29, 29, 29)
                        .addComponent(jLabel11, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(txtExpiredDay, javax.swing.GroupLayout.PREFERRED_SIZE, 57, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jButton4)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 60, Short.MAX_VALUE)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton5)
                    .addComponent(txtOK))
                .addGap(36, 36, 36))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel9)
                            .addComponent(txtType2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel10)
                            .addComponent(txtDateStart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(txtExpiredDay, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jButton3)
                            .addComponent(jButton4)
                            .addComponent(jLabel11)
                            .addComponent(jButton5)))
                    .addComponent(txtOK))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(79, 79, 79)
                        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel2Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(18, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(34, 34, 34)
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(41, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Bill Overdue", new javax.swing.ImageIcon(getClass().getResource("/Icon/bill.png")), jPanel2); // NOI18N

        jPanel3.setForeground(new java.awt.Color(0, 102, 102));
        jPanel3.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N

        jLabel3.setFont(new java.awt.Font("Tahoma", 0, 24));
        jLabel3.setForeground(new java.awt.Color(51, 51, 255));

        btnRemove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/Remove.png"))); // NOI18N
        btnRemove.setText("Remove");
        btnRemove.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnRemoveActionPerformed(evt);
            }
        });

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Billing information", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(12, 73, 73))); // NOI18N

        tableBillsComplete.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(tableBillsComplete);

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 699, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(32, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel6Layout.createSequentialGroup()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search Bill Type", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(13, 68, 68))); // NOI18N

        txtSearch1.setFont(new java.awt.Font("Tahoma", 1, 12));
        txtSearch1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/search2.png"))); // NOI18N
        txtSearch1.setText("Search");
        txtSearch1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtSearch1ActionPerformed(evt);
            }
        });

        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel6.setText("Bill Type");

        jButton6.setFont(new java.awt.Font("Tahoma", 1, 11));
        jButton6.setForeground(new java.awt.Color(20, 91, 91));
        jButton6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Icon/reset.png"))); // NOI18N
        jButton6.setText("Reset");
        jButton6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addGap(40, 40, 40)
                .addComponent(jLabel6)
                .addGap(51, 51, 51)
                .addComponent(txtType3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 137, Short.MAX_VALUE)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jButton6)
                    .addComponent(txtSearch1))
                .addGap(47, 47, 47))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel9Layout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(txtType3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6)))
                    .addComponent(txtSearch1))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jButton6))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(59, 59, 59)
                .addComponent(jLabel3)
                .addGap(55, 55, 55)
                .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(222, Short.MAX_VALUE))
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(27, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addContainerGap(630, Short.MAX_VALUE)
                .addComponent(btnRemove)
                .addGap(71, 71, 71))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(34, 34, 34)
                        .addComponent(jLabel3))
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnRemove)
                .addContainerGap(15, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Bill Complete", new javax.swing.ImageIcon(getClass().getResource("/Icon/bill.png")), jPanel3); // NOI18N

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 805, Short.MAX_VALUE)
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 438, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(23, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void btnRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnRemoveActionPerformed
this.deleteBill();
        // TOD
    }//GEN-LAST:event_btnRemoveActionPerformed

    private void txtSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearchActionPerformed
  try {
// TODO add your handling code here:
            this.SearchBillWaitting();
        } catch (SQLException ex) {
         //   ex.printStackTrace();
        }
        // TODO add your handling code here:
    }//GEN-LAST:event_txtSearchActionPerformed

    private void jToggleButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jToggleButton1ActionPerformed
txfDateStart.setText("");
txfExpiredTime.setText("");
txtType.setSelectedIndex(0);
        // TODO add your handling code here:
    }//GEN-LAST:event_jToggleButton1ActionPerformed

    private void txtOKActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtOKActionPerformed
 try {
// TODO add your handling code here:
            this.SearchBillOverduce();
        } catch (SQLException ex) {
         //   ex.printStackTrace();
        }
        // TODO add your handling code here:
    }//GEN-LAST:event_txtOKActionPerformed

    private void txtSearch1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearch1ActionPerformed
     try {
// TODO add your handling code here:
            this.SearchBillComple();
        } catch (SQLException ex) {
         //   ex.printStackTrace();
        }    // TODO add your handling code here:
    }//GEN-LAST:event_txtSearch1ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
DateChooser dateChooser = new DateChooser((Frame) null, "Select your birthday");
        Date getDate = new Date();
        getDate = (Date) dateChooser.select(getDate);
        Date birthday;
        if(getDate== null) {
            birthday = new Date();
            return;
        }
        birthday = getDate;
        SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd");
        txfDateStart.setText(formatDate.format(birthday));
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
DateChooser dateChooser = new DateChooser((Frame) null, "Select your birthday");
        Date getDate = new Date();
        getDate = dateChooser.select(getDate);
        Date birthday;
        if(getDate== null) {
            birthday = new Date();
            return;
        }
        birthday = getDate;
        SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd");
        txfExpiredTime.setText(formatDate.format(birthday));
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
DateChooser dateChooser = new DateChooser((Frame) null, "Select your birthday");
        Date getDate = new Date();
        getDate = dateChooser.select(getDate);
        Date birthday;
        if(getDate== null) {
            birthday = new Date();
            return;
        }
        birthday = getDate;
        SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd");
        txtDateStart.setText(formatDate.format(birthday));
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton3ActionPerformed

    private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
DateChooser dateChooser = new DateChooser((Frame) null, "Select your birthday");
        Date getDate = new Date();
        getDate = dateChooser.select(getDate);
        Date birthday;
        if(getDate== null) {
            birthday = new Date();
            return;
        }
        birthday = getDate;
        SimpleDateFormat formatDate = new SimpleDateFormat("yyyyMMdd");
        txtExpiredDay.setText(formatDate.format(birthday));
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton4ActionPerformed

    private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton6ActionPerformed
txtType3.setSelectedIndex(0);
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton6ActionPerformed

    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton5ActionPerformed
txtType2.setSelectedIndex(0);
txtDateStart.setText("");
txtExpiredDay.setText("");
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton5ActionPerformed
    
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnRemove;
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JToggleButton jToggleButton1;
    private javax.swing.JTable tableBillsComplete;
    private javax.swing.JTable tableBillsOverDue;
    private javax.swing.JTable tableBillsWaitting;
    private javax.swing.JTextField txfDateStart;
    private javax.swing.JTextField txfExpiredTime;
    private javax.swing.JTextField txtDateStart;
    private javax.swing.JTextField txtExpiredDay;
    private javax.swing.JButton txtOK;
    private javax.swing.JButton txtSearch;
    private javax.swing.JButton txtSearch1;
    private javax.swing.JComboBox txtType;
    private javax.swing.JComboBox txtType2;
    private javax.swing.JComboBox txtType3;
    // End of variables declaration//GEN-END:variables
    
}
